New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

mini-notifier

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-notifier

Show notification, confirmation, prompt


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created

miniNotifier

Show notification, confirmation, prompt

Installation

npm install mini-notifier

Utilisation

<link rel="stylesheet" href="dist/style.css">
<script src="dist/mini-notifier.umd.cjs"></script>
<script>
  { notify, prompt, confirm, configure } = miniNotifier;
</script>

with a bundler like vite or webpack.

import { notify, prompt, confirm, configure } from 'mini-notifier';
import 'mini-notifier/dist/style.css';
notify('hello world');

notify(message, {
  time: 5000,
  style: 'success|error',
  position: 'top-left'
});

confirm('Are you sure ?', {
  okText: 'Yes',
  cancelText: 'Sorry, no',
  okHandler: () => console.log('ok'),
  cancelHandler: () => console.log('cancel')
});


prompt('Enter your email', {
  okText: 'Enter',
  okHandler: (data) => console.log('your email:', data),
  inputType: 'email',
  placeholder: 'team@ifmo.su'
})

notify('hello world', {
  container: document.querySelector('#box')
});

configure({
  container: document.body,
  position: 'bottom-left',
  themePrefix: 'penta'
});

Theme

If you want to custom the MiniNotifier theme. You can define your own css vars.

:root {
  --primary-color500: #ffea66;

  --red500: #dc3545;
  --red200: #f8d7da;
  --green500: #2b5229;
  --green200: #e1fae1;

  --border-radius: .25rem;
}

in order to integrate as much as possible into your application, no css has been applied to the buttons.

If you want ready-to-go theme you can add pentatrion-theme package from npm.

import "pentatrion-theme/css/button.scss";
import "pentatrion-theme/css/text-textarea-select.scss";
import "pentatrion-theme/css/variables.scss";

Keywords

FAQs

Package last updated on 17 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts